import request from '@/utils/request'



// 新增设备
export function addVariable(data) {
  return request({
    url: '/iot/variable',
    method: 'post',
    data: data
  })
}

// 修改设备
export function updateVariable(data) {
  return request({
    url: '/iot/variable',
    method: 'put',
    data: data
  })
}

// 删除设备
export function delDevice(id) {
  return request({
    url: '/iot/device/' + id,
    method: 'delete'
  })
}

// 查询设备变量
export function listDeviceVariable(params) {
  return request({
    url: '/iot/device/variableValueList',
    method: 'get',
    params
  })
}

// 修改设备变量当前值
export function updateDeviceVariableValue(data) {
  return request({
    url: '/iot/modbus/udpateValve',
    method: 'put',
    data
  })
}

// 查询设备变量
export function listTempVariable(params) {
  return request({
    url: '/iot/device/variableList',
    method: 'get',
    params
  })
}

// 删除设备变量
export function delVariable(id) {
  return request({
    url: '/iot/variable/' + id,
    method: 'delete'
  })
}
